<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>用户主页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/css/global.css}">
</head>
<body style="margin-top: 65px;">

<div th:include="common/header::header"></div>
<script id="user" type="text/html">
<div class="fly-home">
    <img src="{{d.data.user.icon}}" alt="">
    <h1>
        {{d.data.user.username}}
        {{ d.data.user.sex == 0 ? ' <i class="iconfont icon-nan"></i>' : ''}}
        {{ d.data.user.sex == 1 ? ' <i class="iconfont icon-nv"></i>' : ''}}
    </h1>
    <p class="fly-home-info">
        <!--<i class="iconfont icon-zuichun" title="飞吻"></i><span style="color: #FF7200;">67206飞吻</span>-->
        <i class="iconfont icon-shijian"></i><span>{{d.data.user.initTime}} 加入</span>
    </p>
    <p class="fly-home-sign">{{d.data.user.signature}}</p>
</div>

<div class="main fly-home-main">
    <div class="layui-inline fly-home-jie">
        <div class="fly-panel">
            <h3 class="fly-panel-title">{{d.data.user.username}} 最近的发帖</h3>
            <ul class="jie-row" >
                {{# layui.each(d.data.posts, function(index, item){ }}
                <li>
                    {{ item.good == true ? ' <span class="fly-jing">精</span>' : ''}}
                    <a href="../posts/detail?id={{item.id}}" class="jie-title">{{item.title}}</a>
                    <i>{{item.initTime}}</i>
                    <em>{{item.replyCount}}</em>
                </li>
                {{# }); }}
            </ul>
        </div>


    </div>
</div>

</div>
</script>
<div id="users"></div>
<div th:include="common/footer::footer"></div>
<script>
    var token =  getCookie();
    layui.use(['laytpl'],function () {
        var laytpl = layui.laytpl;

        $.get(quark_getUserByToken_api+token,function (data) {
            var user = $("#user").html();
            laytpl(user).render(data,function (html) {
                $("#users").html(html);
            })

        });


    })
//    alert(uid)
</script>

</body>
</html>